package com.jusu.biz;

import java.lang.reflect.Array;
import java.util.HashMap;
import java.util.List;

import com.jusu.dao.IShopDao;
import com.jusu.dao.ShopDaoImpl;
import com.jusu.entity.Shop;

public class ShopBizImpl implements IShopBiz{

	IShopDao sdi = new ShopDaoImpl();
	
	public List<Shop> show() {
		List<Shop> shopList = sdi.showByPage(1, 4);
		return shopList;
	}

	@Override
	public List<Shop> showByHot() {
		HashMap map = new HashMap<>();
		map.put("start", 1);
		map.put("end", 4);
		List<Shop> shopList = sdi.showByHot(map);
		return shopList;
	}

	@Override
	public int[] showAllWidthNode() {
		HashMap map = new HashMap<>();
		map.put("choise", "width");
		List<Shop> shopList = sdi.show(map);
		int[] arr = new int[shopList.size()];
		for(int i=0;i<shopList.size();i++){
			arr[i] = shopList.get(i).getWidth();
		}
		
		return arr;
	}

	@Override
	public int[] showAllSizeNode() {
		HashMap<String, String> map = new HashMap<>();
		map.put("choise", "sSize");
		List<Shop> shopList = sdi.show(map);
		int[] arr = new int[shopList.size()];
		for(int i =0;i<shopList.size();i++){
			arr[i] = shopList.get(i).getsSize();
		}
		return arr;
	}

}
